/* $Id: UserDetailVO.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  				Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 * March 6, 2012 	   Ismail		 		Created
 *
 */
package ae.pcfc.etks.online.common.vo;

import java.io.Serializable;

import ae.pcfc.etks.online.common.ConstantsCommon;

public class UserDetailVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1049440727195631772L;
	private Long userId;
	private String name;
	private String nameArab;
	private String email;
	private String clientType;
	private String userName;
	private String mobile;
	private String smsNotification;
	private String emailNotification;
	private String userType;
	private String status;
	private String trakheesId;
	private SCCompanyVO companyVO;
	private SCPersonVO personVO;

	public SCCompanyVO getCompanyVO() {
		return companyVO;
	}

	public void setCompanyVO(SCCompanyVO companyVO) {
		this.companyVO = companyVO;
	}

	public SCPersonVO getPersonVO() {
		return personVO;
	}

	public void setPersonVO(SCPersonVO personVO) {
		this.personVO = personVO;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNameArab() {
		return nameArab;
	}

	public void setNameArab(String nameArab) {
		this.nameArab = nameArab;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getClientType() {
		return clientType;
	}

	public void setClientType(String clientType) {
		this.clientType = clientType;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getSmsNotification() {
		return smsNotification;
	}

	public void setSmsNotification(String smsNotification) {
		this.smsNotification = smsNotification;
	}

	public String getEmailNotification() {
		return emailNotification;
	}

	public void setEmailNotification(String emailNotification) {
		this.emailNotification = emailNotification;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getTrakheesId() {
		return trakheesId;
	}

	public void setTrakheesId(String trakheesId) {
		this.trakheesId = trakheesId;
	}

	public boolean isSystemAdmin() {
		return ConstantsCommon.ADMIN.equalsIgnoreCase(userType);
	}

	public boolean isClientAdmin() {
		return ConstantsCommon.COMPANY_ADMIN.equalsIgnoreCase(userType);
	}

	public boolean isCompanyEmployee() {
		return ConstantsCommon.COMPANY_EMPLOYEE.equalsIgnoreCase(userType);
	}

	public boolean isMobileNotificationEnabled() {
		return ConstantsCommon.ENABLE.equalsIgnoreCase(smsNotification);
	}

	public boolean isEmailNotificationEnabled() {
		return ConstantsCommon.ENABLE.equalsIgnoreCase(emailNotification);
	}

	public boolean isCompanyClient() {
		return ConstantsCommon.COMPANY.equalsIgnoreCase(clientType);
	}

	public boolean isPersonClient() {
		return ConstantsCommon.PERSON.equalsIgnoreCase(clientType);
	}

	public boolean isUserActive() {
		return ConstantsCommon.ACTIVE.equalsIgnoreCase(status);
	}
	@Override
	public boolean equals(Object obj) {
		// TODO Auto-generated method stub
		// TODO Auto-generated method stub
		if(!(obj instanceof UserDetailVO)){
			return false;
		}
		UserDetailVO userDetailVO = (UserDetailVO)obj;
		if(this.getUserId().longValue() == userDetailVO.getUserId().longValue()){
			return true;
		}
		return super.equals(obj);	
	}
}
